/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "song_artistalbums")
//@NamedQueries({@NamedQuery(name = "SongArtistalbums.findAll", query = "SELECT s FROM SongArtistalbums s"), @NamedQuery(name = "SongArtistalbums.findByArtistId", query = "SELECT s FROM SongArtistalbums s WHERE s.songArtistalbumsPK.artistId = :artistId"), @NamedQuery(name = "SongArtistalbums.findByAlbumId", query = "SELECT s FROM SongArtistalbums s WHERE s.songArtistalbumsPK.albumId = :albumId")})
public class SongArtistalbums implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SongArtistalbumsPK songArtistalbumsPK;

    public SongArtistalbums() {
    }

    public SongArtistalbums(SongArtistalbumsPK songArtistalbumsPK) {
        this.songArtistalbumsPK = songArtistalbumsPK;
    }

    public SongArtistalbums(int artistId, int albumId) {
        this.songArtistalbumsPK = new SongArtistalbumsPK(artistId, albumId);
    }

    public SongArtistalbumsPK getSongArtistalbumsPK() {
        return songArtistalbumsPK;
    }

    public void setSongArtistalbumsPK(SongArtistalbumsPK songArtistalbumsPK) {
        this.songArtistalbumsPK = songArtistalbumsPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (songArtistalbumsPK != null ? songArtistalbumsPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SongArtistalbums)) {
            return false;
        }
        SongArtistalbums other = (SongArtistalbums) object;
        if ((this.songArtistalbumsPK == null && other.songArtistalbumsPK != null) || (this.songArtistalbumsPK != null && !this.songArtistalbumsPK.equals(other.songArtistalbumsPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.SongArtistalbums[songArtistalbumsPK=" + songArtistalbumsPK + "]";
    }

}
